<%@ page import="com.conversationboard.model.*" %>
<%@ page import="com.conversationboard.view.*" %>
<%@ page import="com.conversationboard.config.*" %>
<%@ page import="com.conversationboard.controller.confirm.Confirm"%>

<%@ page import="java.util.*" %>

<%@page pageEncoding="UTF-8"%>
<%@page contentType="text/html;charset=UTF-8"%>

<% 
	List<LogMessage> errors = (List<LogMessage>) request.getAttribute("errors");
	String key = Confirm.getKey(request.getUserPrincipal().getName());
%>

<html>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<title>Log</title>
	<link rel="stylesheet" type="text/css" href="<%=Configuration.getInstance().getRoot()%>/Stylesheets/<%=StyleSheets.getStyleSheetFileName(request.getCookies())%>">
</head>

	<body>
	
		<%= MainMenu.display(request.getUserPrincipal()) %>
	
			<div class="headingblock">
				<h1>Log</h1>
			</div>
	
			<div class="mainblock">

				<div class="formsection">

				<table class="table">

				<tr class="row">
					<td class="cell">
						<form action="<%=Configuration.getInstance().getRoot()%>/Admin/AdminClearLogServlet?type=USER" method="post">
							<%= key %>
					 		<input type="submit" value="Clear User Logs" />
						</form>
					</td>
					
					<td class="cell">
						<form action="<%=Configuration.getInstance().getRoot()%>/Admin/AdminClearLogServlet?type=SYSTEM" method="post">
							<%= key %>
					 		<input type="submit" value="Clear System Logs" />
						</form>
					</td>
					
					<td class="cell">
						<form action="<%=Configuration.getInstance().getRoot()%>/Admin/AdminClearLogServlet?type=SERVER" method="post">
							<%= key %>
					 		<input type="submit" value="Clear Server Logs" />
						</form>
					</td>
		
					<td class="cell">
						<form action="<%=Configuration.getInstance().getRoot()%>/Admin/AdminClearLogServlet?type=DEBUG" method="post">
							<%= key %>
					 		<input type="submit" value="Clear Debug Logs" />
						</form>
					</td>
					
					<td class="cell">
					</td>
					
				</tr>
				
				<tr class="row">
					<td class="cell"><a href="<%= Configuration.getInstance().getRoot() %>/Admin/AdminShowLogControllerServlet?type=USER">Show User Logs</a></td>
					<td class="cell"><a href="<%= Configuration.getInstance().getRoot() %>/Admin/AdminShowLogControllerServlet?type=SYSTEM">Show System Logs</a></td>
					<td class="cell"><a href="<%= Configuration.getInstance().getRoot() %>/Admin/AdminShowLogControllerServlet?type=SERVER">Show Server Logs</a></td>
					<td class="cell"><a href="<%= Configuration.getInstance().getRoot() %>/Admin/AdminShowLogControllerServlet?type=DEBUG">Show Debug Logs</a></td>
					<td class="cell"><a href="<%= Configuration.getInstance().getRoot() %>/Admin/AdminShowLogControllerServlet?type=ALL">Show All Logs</a></td>
				</tr>
				
				</table>

			</div>
				
			<br />
				
			<div class="formsection">
				<%= LogDisplay.display(errors) %>
			</div>
			
		</div>
		
		<!--<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>-->
		<!--<script type="text/javascript">_uacct = "UA-1148679-1";urchinTracker();</script>--> 
		
	</body>

</html>
